package com.homework;

import java.util.Vector;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/2 18:32
 * @description
 */
public class T4 {
    public static void main(String[] args) {
        Vector<Integer> vector = new Vector<>();
        vector.add(1);
        vector.add(1);
        vector.add(3);
        vector.add(3);
        vector.add(5);
        vector.add(5);
        System.out.println("去重前:" + vector);

        Vector<Integer> vector1 = new Vector<>();
        for(Integer old : vector){
            if(!vector1.contains(old)){
                vector1.add(old);
            }
        }
        System.out.println("去重后：" + vector1);
    }
}
